Skip to main content

Serialize

EOSIO Javascript / Exports / Serialize

Namespace: Serialize

Table of contents

Classes

Interfaces

Functions

Functions

arrayToHex

arrayToHex(data): string

Convert binary data to hex

Parameters

NameType
dataUint8Array

Returns

string

Defined in

src/eosjs-serialize.ts:614


blockTimestampToDate

blockTimestampToDate(slot): string

Convert block_timestamp_type (half-seconds since a different epoch) to to date in ISO format

Parameters

NameType
slotnumber

Returns

string

Defined in

src/eosjs-serialize.ts:591


createInitialTypes

createInitialTypes(): Map<string, Type>

Create the set of types built-in to the abi format

Returns

Map<string, Type>

Defined in

src/eosjs-serialize.ts:798


dateToBlockTimestamp

dateToBlockTimestamp(date): number

Convert date in ISO format to block_timestamp_type (half-seconds since a different epoch)

Parameters

NameType
datestring

Returns

number

Defined in

src/eosjs-serialize.ts:586


dateToTimePoint

dateToTimePoint(date): number

Convert date in ISO format to time_point (miliseconds since epoch)

Parameters

NameType
datestring

Returns

number

Defined in

src/eosjs-serialize.ts:564


dateToTimePointSec

dateToTimePointSec(date): number

Convert date in ISO format to time_point_sec (seconds since epoch)

Parameters

NameType
datestring

Returns

number

Defined in

src/eosjs-serialize.ts:575


deserializeAction

deserializeAction(contract, account, name, authorization, data, textEncoder, textDecoder): Action

Deserialize action. If data is a string, then it's assumed to be in hex.

Parameters

NameType
contractContract
accountstring
namestring
authorizationAuthorization[]
datastring | Uint8Array | number[]
textEncoderTextEncoder
textDecoderTextDecoder

Returns

Action

Defined in

src/eosjs-serialize.ts:1133


deserializeActionData

deserializeActionData(contract, account, name, data, textEncoder, textDecoder): any

Deserialize action data. If data is a string, then it's assumed to be in hex.

Parameters

NameType
contractContract
accountstring
namestring
datastring | Uint8Array | number[]
textEncoderTextEncoder
textDecoderTextDecoder

Returns

any

Defined in

src/eosjs-serialize.ts:1117


getType

getType(types, name): Type

Get type from types

Parameters

NameType
typesMap<string, Type>
namestring

Returns

Type

Defined in

src/eosjs-serialize.ts:996


getTypesFromAbi

getTypesFromAbi(initialTypes, abi): Map<string, Type>

Get types from abi

Parameters

NameTypeDescription
initialTypesMap<string, Type>Set of types to build on. In most cases, it's best to fill this from a fresh call to getTypesFromAbi().
abiAbi-

Returns

Map<string, Type>

Defined in

src/eosjs-serialize.ts:1036


hexToUint8Array

hexToUint8Array(hex): Uint8Array

Convert hex to binary data

Parameters

NameType
hexstring

Returns

Uint8Array

Defined in

src/eosjs-serialize.ts:623


serializeAction

serializeAction(contract, account, name, authorization, data, textEncoder, textDecoder): SerializedAction

Return action in serialized form

Parameters

NameType
contractContract
accountstring
namestring
authorizationAuthorization[]
dataany
textEncoderTextEncoder
textDecoderTextDecoder

Returns

SerializedAction

Defined in

src/eosjs-serialize.ts:1105


serializeActionData

serializeActionData(contract, account, name, data, textEncoder, textDecoder): string

Convert action data to serialized form (hex)

Parameters

NameType
contractContract
accountstring
namestring
dataany
textEncoderTextEncoder
textDecoderTextDecoder

Returns

string

Defined in

src/eosjs-serialize.ts:1093


stringToSymbol

stringToSymbol(s): Object

Convert string to Symbol. format: precision,NAME.

Parameters

NameType
sstring

Returns

Object

NameType
namestring
precisionnumber

Defined in

src/eosjs-serialize.ts:597


supportedAbiVersion

supportedAbiVersion(version): boolean

Is this a supported ABI version?

Parameters

NameType
versionstring

Returns

boolean

Defined in

src/eosjs-serialize.ts:551


symbolToString

symbolToString(__namedParameters): string

Convert Symbol to string. format: precision,NAME.

Parameters

NameType
__namedParametersObject
__namedParameters.namestring
__namedParameters.precisionnumber

Returns

string

Defined in

src/eosjs-serialize.ts:609


timePointSecToDate

timePointSecToDate(sec): string

Convert time_point_sec (seconds since epoch) to to date in ISO format

Parameters

NameType
secnumber

Returns

string

Defined in

src/eosjs-serialize.ts:580


timePointToDate

timePointToDate(us): string

Convert time_point (miliseconds since epoch) to date in ISO format

Parameters

NameType
usnumber

Returns

string

Defined in

src/eosjs-serialize.ts:569


transactionHeader

transactionHeader(refBlock, expireSeconds): Object

TAPoS: Return transaction fields which reference refBlock and expire expireSeconds after timestamp

Parameters

NameType
refBlockBlockTaposInfo
expireSecondsnumber

Returns

Object

NameType
expirationstring
ref_block_numnumber
ref_block_prefixnumber

Defined in

src/eosjs-serialize.ts:1081